#{extends 'main.html' /} #{set title:'Seller' /}


<!--Page Title-->
<br /> <img src="/public/images/layout/header_admin.jpg" />

<div id="top_bestsellers">
	<div class="title">Manage Inventory</div>
	<button onclick="parent.location.href='/seller/addItem/'">Add New Item</button>
	<div class="clear"></div>
	
	%{
		for(item in itemList) {
	}%
    
	<div class="bestseller">
		<table>
			<tr>
				<td><img src="http://covers.openlibrary.org/b/isbn/${item.getProductListingDetails().getISBN()}-M.jpg" class="list_img" /></td>
				<td>
					<table>
						<tr><td colspan="2"><b>${item.getTitle()}</b>  ${item.getStartPrice().getValue().formatCurrency('USD').raw()}</td></tr>
						<tr>
							<td width="100">Item ID:</td>
							<td>${item.getItemID()}</td>
						</tr>
						<tr>
							<td>ISBN:</td>
							<td>${item.getProductListingDetails().getISBN()}</td>
						</tr>
							<td>Duration:</td>
							<td>${item.getListingDuration().substring(5)} DAYS</td>
						</tr>
						<tr>
							<td>Shipping:</td>
							<td>${item.getShippingDetails().getShippingServiceOptions(0).getShippingServiceCost().getValue().formatCurrency('USD').raw()}</td>
						</tr>
						<tr>
							<td>Description:</td>
							<td>${item.getDescription()}</td>
						</tr>
					</table><br />
					<button onclick="parent.location.href='/seller/editItem?itemIDStr=${item.getItemID()}'">Edit Listing</button>
					<button onclick="parent.location.href='/seller/deleteItem?itemIDStr=${item.getItemID()}'">Delete Listing</button>				
				</td>
			</tr>
		</table>		
	</div>
	<div class="clear"></div>
	%{ } }%
	<div class="clear"></div>
</div>
